//
//  LSZDedicationManager.m
//  JKFuYinProject
//
//  Created by 九酷 on 2017/9/22.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZDedicationManager.h"

@implementation LSZDedicationManager
-(id)initWithDedicationManager:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        self.mutDataArray = [[NSMutableArray alloc]init];
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSArray * arrayData = dic[@"data"];
        NSMutableArray * mutArrayData= [[NSMutableArray alloc]init];
        for (NSDictionary * dic in arrayData) {
            LSZDedicationMg * dedicationMg = [[LSZDedicationMg alloc]init];
            dedicationMg.cash = [NSString stringWithFormat:@"%@",dic[@"cash"]];
            float money = [dic[@"credit"] floatValue]/1000;
            dedicationMg.credit = [NSString stringWithFormat:@"%.2f",money];
            dedicationMg.id_id = [NSString stringWithFormat:@"%@",dic[@"id"]];
            NSString * gender = [NSString stringWithFormat:@"%@",dic[@"gender"]];
            if ([gender isEqualToString:@"1"]) {
                dedicationMg.gender = @"弟兄";
            }else if ([gender isEqualToString:@"2"])
            {
                dedicationMg.gender = @"姊妹";
            }else{
                dedicationMg.gender = @"";
            }
            dedicationMg.location = [NSString stringWithFormat:@"%@",dic[@"location"]];
            dedicationMg.note = [NSString stringWithFormat:@"%@",dic[@"note"]];
            dedicationMg.score = [NSString stringWithFormat:@"%@",dic[@"score"]];
            dedicationMg.trade_no = [NSString stringWithFormat:@"%@",dic[@"trade_no"]];
            dedicationMg.uid = [NSString stringWithFormat:@"%@",dic[@"uid"]];
            NSString * timeStr = [NSString stringWithFormat:@"%@",dic[@"uptime"]];
            dedicationMg.uptime =  [LSZSpecialPackaging GetThePreviousTimeAndCompareItNow:timeStr];
            dedicationMg.username = [NSString stringWithFormat:@"%@",dic[@"username"]];
            [mutArrayData addObject:dedicationMg];
        }
        self.mutDataArray  = mutArrayData;
    }
    return self;
}
@end
@implementation LSZDedicationMg

@end
